TargetHasGUI Constant

Used to indicate whether the application has a GUI. ConsoleApplications do not.

result=TargetHasGUI

PartTypeDescription
result Boolean Returns True if are compiling REALbasic code that supports a GUI.


Example

Use TargetHasGUI to isolate code for a version of the application that runs as a console application. The following example writes an error message to the standard error stream if the application has no GUI.

Sub DisplayError(err as String)
 #if TargetHasGUI
   MsgBox err
 #else
   StdErr.WriteLine err
 #endif

See Also

DebugBuild, RBVersion, RBVersionString, TargetBigEndian, TargetCarbon, TargetLinux, TargetLittleEndian, TargetMachO, TargetMacOS, TargetMacOSClassic, TargetMachO, TargetWin32 constants; #If statement; ConsoleApplication, ServiceApplication classes.